package com.acsior.hibernate.vo;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.ddfn.impl.hibernate.vo.NomElementVO;

/**
 * PriceList entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "price_lists", uniqueConstraints = @UniqueConstraint(columnNames = "system_name"))
@GeneratorKey(tableName = "price_lists")
public class PriceListVO extends NomElementVO {

	private static final long serialVersionUID = 2878666795945099931L;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "crCodeID", nullable = false)
	private CdCRCodeVO cdCRCode;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "priceList")
	private List<TabularListVO> tabularLists;

	@Column(name = "tariff_value", nullable = false, precision = 10)
	private double tariffValue;

	/** default constructor */
	public PriceListVO() {
		this.tabularLists = new ArrayList<TabularListVO>();
	}

	/** @return the cdCRCode */
	public CdCRCodeVO getCdCRCode() {
		return this.cdCRCode;
	}

	/** @return the tabularLists */
	public List<TabularListVO> getTabularLists() {
		return this.tabularLists;
	}

	/** @return the tariffValue */
	public double getTariffValue() {
		return this.tariffValue;
	}

	/**
	 * @param cdCRCode
	 *            the cdCRCode to set
	 */
	public void setCdCRCode(CdCRCodeVO cdCRCode) {
		this.cdCRCode = cdCRCode;
	}

	/**
	 * @param tabularLists
	 *            the tabularLists to set
	 */
	public void setTabularLists(List<TabularListVO> tabularLists) {
		this.tabularLists = tabularLists;
	}

	/**
	 * @param tariffValue
	 *            the tariffValue to set
	 */
	public void setTariffValue(double tariffValue) {
		this.tariffValue = tariffValue;
	}

}